<script setup lang="ts">
import { OrderType } from '@/enums'

defineProps<{
  status?: OrderType
}>()
</script>

<template>
  <div class="room-status">
    <div v-if="status === OrderType.待接诊" class="wait">
      已通知医生尽快接诊，24小时内医生未回复将自动退款
    </div>
    <div v-if="status === OrderType.咨询中" class="chat">
      <span>咨询中</span>
    </div>
    <div
      v-if="status === OrderType.已完成 || status === OrderType.已取消"
      class="end"
    >
      <van-icon name="passed" /> 已结束
    </div>
  </div>
</template>

<style lang="scss" scoped>
.room-status {
  position: fixed;
  left: 0;
  top: 46px;
  height: 44px;
  width: 100%;
  background-color: #fff;
  font-size: 13px;
  z-index: 1;
  .wait {
    padding: 0 15px;
    background-color: var(--cp-plain);
    height: 100%;
    line-height: 44px;
    text-align: center;
    color: var(--cp-primary);
  }
  .chat {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    span {
      &:first-child {
        color: var(--cp-primary);
      }
      &:last-child {
        color: var(--cp-text2);
        width: 130px;
        .van-count-down {
          display: inline;
        }
      }
    }
  }
  .end {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 15px;
    font-weight: 500;
    .van-icon {
      font-size: 14px;
      margin-right: 4px;
      position: relative;
      top: 1px;
    }
  }
}
</style>
